package graphics;
/*
 * Zombinoes: Peter Mosher, Michael Pitts
 * TCSS 491 - Computational Worlds
 * Project 1
 */

import java.util.List;

import javax.media.opengl.GL2;

/**
 * This is a node in a graphics tree, it can display graphical 3D data by calling the
 * display() method.
 * @author Michael Pitts
 * @version Jan 23, 2012
 */
public interface Node {

	/**
	 * Displays this node and its children, after any transformations.
	 * @param the_gl is the graphics object.
	 */
	public void display(final GL2 the_gl);
	
	/**
	 * Tests this node and all of its children to see if they have been selected.
	 * @param the_gl is the graphics object.
	 * @param returns true if this node or one of its children was selected.
	 * @see Node#isSelected()
	 */
	public boolean testSelect(final GL2 the_gl);
	
	/**
	 * Sets the rotation data for this node.
	 * @param the_angle is the angle by which to set the rotation.
	 * @param the_rotate_x is how much of the rotation is about the x-axis.
	 * @param the_rotate_y is how much of the rotation is about the y-axis.
	 * @param the_rotate_z is how much of the rotation is about the z-axis.
	 * @see GL2#glRotatef(float, float, float, float)
	 */
	public void setRotate(final float the_angle, final float the_rotate_x, 
			final float the_rotate_y, final float the_rotate_z);
	
	/**
	 * Sets the visual scale of this node.
	 * @param the_scale_x is how much to scale the x data by.
	 * @param the_scale_y is how much to scale the y data by.
	 * @param the_scale_z is how much to scale the z data by.
	 * @see GL2#glScalef(float, float, float)
	 */
	public void setScale(final float the_scale_x, final float the_scale_y, 
			final float the_scale_z);
	/**
	 * Sets how much the node will be translated by.
	 * @param the_trans_x how far to translate in the x-axis.
	 * @param the_trans_y how far to translate in the y-axis.
	 * @param the_trans_z how far to translate in the z-axis.
	 * @see GL2#glTranslatef(float, float, float)
	 */
	public void setTranslate(final float the_trans_x, final float the_trans_y, 
			final float the_trans_z);
	
	/** Gets the current rotation angle. */
	public float getRotateAngle();
	
	/** Gets the current rotation x value. */
	public float getRotateX();
	
	/** Gets the current rotation y value. */
	public float getRotateY();
	
	/** Gets the current rotation z value. */
	public float getRotateZ();
	
	/** Gets the current scale x value. */
	public float getScaleX();
	
	/** Gets the current scale y value. */
	public float getScaleY();
	
	/** Gets the current scale z value. */
	public float getScaleZ();
	
	/** Gets the current translate x value. */
	public float getTranslateX();
	
	/** Gets the current translate y value. */
	public float getTranslateY();
	
	/** Gets the current translate z value. */
	public float getTranslateZ();
	
	/**
	 * Returns if the current node, or one of its children was selected in the
	 * last call to testSelect().
	 * @return true if this node or a child was selected, false otherwise.
	 * @see Node#testSelect(GL2)
	 */
	public boolean isSelected();
	
	/**
	 * Clears this node and all of its children of having been selected.
	 */
	public void clearSelect();
	
	/** Gets the children of this node. */
	public List<Node> getChildren();
	
	/**
	 * Updates the given node with the given data.  Each node will have a unique
	 * method for handling this.
	 */
	public void update(final Object... the_data);
}
